<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <jsp:include flush="true" page="_header.jsp"></jsp:include>
  <body>
  	<logic:empty name="articletypelist">
    	没有内容
    </logic:empty>
    <logic:notEmpty name="articletypelist">
    <table class="tablelist" cellpadding="0" cellspacing="0">
    	<tr>
    		<th width="10%">序号</th>
    		<th width="80%">名字</th>
    		<th width="10%">操作</th>
    	</tr>
    	<logic:iterate id="articletype" name="articletypelist">
    	<tr>
    		<td align="center"><bean:write name="articletype" property="id" /></td>
    		<td><bean:write name="articletype" property="articletype" /></td>
    		<td>子分类</td>
    	</tr>
    	</logic:iterate>
    </table>
    <div class="zTreeDemoBackground left">
		<ul id="treeDemo" class="ztree"></ul>
	</div>
    <script type="text/javascript">
    var setting = {
		data: {
			key: {
				title:"t"
			},
			simpleData: {
				enable: true
			}
		},
		callback: {
			//beforeClick: beforeClick,
			//onClick: onClick
		}
	};

	var zNodes =[
		<logic:iterate id="articletype" name="articletypelist">
		{id:<bean:write name="articletype" property="id" />,t:"<bean:write name="articletype" property="articletype" />"},
		</logic:iterate>
	];
    $(document).ready(function(){
    	$.fn.zTree.init($("#treeDemo"), setting, zNodes);
    });
    </script>
    </logic:notEmpty>
  </body>
</html>